from django.utils.translation import get_language

# experimental
def multilingual_field(**langmap):
    """
    Usage:

    class SomeModel(models.Model):
        ....
        title_ru = models.CharField(max_length=255)
        title_en = models.CharField(max_length=255)
        title = multilingual_field(ru='title_ru', en='title_en')
        ....
    """
    if 'en' in langmap:
        langmap['en-us'] = langmap['en']
    return property(lambda self: getattr(self, langmap[get_language()]),
                    lambda self, value: setattr(self, langmap[get_language()], value))
